var Component = {
	Combobox: {
		Language: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentLanguageComboboxLabel;
				inputContainer.combobox({
					valueField: 'languageFlag',
					textField: 'languageName',
					data: [
						{languageFlag: 'chinese', languageName: '中文'},
						{languageFlag: 'vietnamese', languageName: '越南文'},
					],
					value: language,
					onSelect: function(record) {
						$.ajax({
							url: '/index.php/Language/manage/setCurrLanguage',
							data: {'languageFlag': record.languageFlag}
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								window.location = '/index.php/Portal/portal';
							}
							else {
								inputContainer.combobox('setValue', language);
							}
						});
					}
				});
			},
		},
		
		UserStatus: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentUserStatusComboboxLabel;
				inputContainer.combobox({
					valueField: 'userStatusId',
					textField: 'userStatusValue',
					data: [
						{userStatusId: '1', userStatusValue: userStatusValue1},
						{userStatusId: '2', userStatusValue: userStatusValue2},
					],
				});
			},
		},
		
		
		OperatorStatus: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentOperatorStatusComboboxLabel;
				inputContainer.combobox({
					valueField: 'operatorStatusId',
					textField: 'operatorStatusValue',
					data: [
						{operatorStatusId: '1', operatorStatusValue: operatorStatusValue1},
						{operatorStatusId: '2', operatorStatusValue: operatorStatusValue2},
					],
				});
			},
		},
		
		IpType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentIpTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'ipTypeId',
					textField: 'ipTypeName',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Ip/type/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data);
							}
						})
					}
				});
			}
		},
		
		ServerType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentServerTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'serverTypeId',
					textField: 'serverTypeName',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Server/type/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data);
							}
						})
					}
				});
			},
		},
		
		ServerStatus: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentServerStatusComboboxLabel;
				inputContainer.combobox({
					valueField: 'serverStatusId',
					textField: 'serverStatusValue',
					data: [
						{serverStatusId: '1', serverStatusValue: serverStatusValue1},
						{serverStatusId: '2', serverStatusValue: serverStatusValue2},
					]
				});
			},
		},
		
		Operator: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentOperatorComboboxLabel;
				inputContainer.combobox({
					valueField: 'operatorId',
					textField: 'operatorName',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Operator/manage/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data.rows);
							}
						})
					},
				});
			},
		},
		
		Server: {
			create: function(labelContainer, inputContainer, serverTypeId) {
				var serverTypeId = arguments[2] === true ? arguments[2] : 3;
				labelContainer[0].innerHTML = componentServerComboboxLabel;
				inputContainer.combobox({
					valueField: 'serverId',
					textField: 'serverName',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Server/manage/getListData',
							data: {
								serverTypeId: serverTypeId,
							}
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data.rows);
							}
						})
					}
				});
			},
		},
		
		GameAreaStatus: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentGameAreaStatusComboboxLabel;
				inputContainer.combobox({
					valueField: 'gameAreaStatusId',
					textField: 'gameAreaStatusValue',
					data: [
						{gameAreaStatusId: '1', gameAreaStatusValue: gameAreaStatusValue1},
						{gameAreaStatusId: '2', gameAreaStatusValue: gameAreaStatusValue2},
						{gameAreaStatusId: '3', gameAreaStatusValue: gameAreaStatusValue3},
						{gameAreaStatusId: '4', gameAreaStatusValue: gameAreaStatusValue4},
						{gameAreaStatusId: '5', gameAreaStatusValue: gameAreaStatusValue5},
						{gameAreaStatusId: '6', gameAreaStatusValue: gameAreaStatusValue6},
						{gameAreaStatusId: '7', gameAreaStatusValue: gameAreaStatusValue7},
					],
				});
			},
		},
		
		TimeCycleType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentTimeCycleTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'timeCycleTypeId',
					textField: 'timeCycleTypeValue',
					data: [
						{timeCycleTypeId: '1', timeCycleTypeValue: timeCycleTypeValue1},
						{timeCycleTypeId: '2', timeCycleTypeValue: timeCycleTypeValue2},
						{timeCycleTypeId: '3', timeCycleTypeValue: timeCycleTypeValue3},
						{timeCycleTypeId: '4', timeCycleTypeValue: timeCycleTypeValue4},
						{timeCycleTypeId: '5', timeCycleTypeValue: timeCycleTypeValue5},
						//{timeCycleTypeId: '6', timeCycleTypeValue: timeCycleTypeValue6},
					],
				});
			},
		},
		
		LogType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentLogTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'logTypeId',
					textField: 'logTypeValue',
					data: [
						{logTypeId: '1', logTypeValue: logTypeValue1},
						{logTypeId: '2', logTypeValue: logTypeValue2},
					],
				});
			},
		},
		
		CurrencyType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentCurrencyTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'currencyTypeId',
					textField: 'currencyTypeValue',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Currency/type/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data.rows);
							}
						})
					},
					value: 1,
				});
			},
		},

		BannedType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentBannedTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'bannedTypeId',
					textField: 'bannedTypeValue',
					data: [
						{bannedTypeId: '1', bannedTypeValue: bannedTypeValue1},
						{bannedTypeId: '2', bannedTypeValue: bannedTypeValue2},
					],
					value: 1,
				});
			}
		},


		
		Item:　{
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentItemComboboxLabel;
				inputContainer.combobox({
					valueField: 'id',
					textField: 'itemName',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Item/manage/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data.rows);
							}
						})
					},
				})
			},
		},
		
		Card: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentCardComboboxLabel;
				inputContainer.combobox({
					valueField: 'cardId',
					textField: 'cardName',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Card/manage/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data.rows);
							}
						})
					},
				})
			},
		},
		
		ReportType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentReportTypeComboboxLabel;
				inputContainer.combobox({
					valueField: 'reportTypeId',
					textField: 'reportTypeValue',
					data: [
						{reportTypeId: '1', reportTypeValue: reportTypeValue1},
						{reportTypeId: '2', reportTypeValue: reportTypeValue2},
					],
					value: 2,
				});
			}
		},
		
		UseLimit: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentUseLimitComboboxLabel;
				inputContainer.combobox({
					valueField: 'useLimitId',
					textField: 'useLimitValue',
					data: [
						{useLimitId: '1', useLimitValue: useLimitValue1},
						{useLimitId: '2', useLimitValue: useLimitValue2},
						{useLimitId: '3', useLimitValue: useLimitValue3},
						{useLimitId: '4', useLimitValue: useLimitValue4},
					],
				});
			},
		},
		
		PaySummaryType: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentPaySummaryComboboxLabel;
				inputContainer.combobox({
					valueField: 'paySummaryTypeId',
					textField: 'paySummaryTypeValue',
					data: [
						{paySummaryTypeId: '1', paySummaryTypeValue: paySummaryTypeValue1},
						{paySummaryTypeId: '2', paySummaryTypeValue: paySummaryTypeValue2},
					],
					value: 1,
				});
			},
		},
		
		Version: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentVersionLabel;
				inputContainer.combobox({
					valueField: 'id',
					textField: 'version',
					loader: function(param, success, error) {
						$.ajax({
							url: '/index.php/Version/manage/getListData',
						})
						.done(function(response) {
							if(response.errorCode === 0) {
								success(response.data.rows);
							}
						});
					},
				});
			},
		},
		
		BattleServerStatus: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentBattleServerStatusLabel;
				inputContainer.combobox({
					valueField: 'id',
					textField: 'value',
					data: [
						{id: '1', value: battleServerStatusValue1},
						{id: '2', value: battleServerStatusValue2},
						{id: '3', value: battleServerStatusValue3},
						{id: '4', value: battleServerStatusValue4},
					],
				});
			},
		},
	},
	
	Combogrid: {
		GameArea: {
			create: function(labelContainer, inputContainer, multiple) {
				var multiple = arguments[2] === true ? arguments[2] : false;
				labelContainer[0].innerHTML = componentGameAreaCombogridLabel;
				inputContainer.combogrid({
					panelWidth: 200,
					panelHeight: 400,
					multiple: multiple,
					idField: 'gameAreaId',
					textField: 'gameAreaName',
					url: '/index.php/GameArea/manage/getListData',
					queryParams: {
						checkPrivilege: 1,
					},
					columns:[[
						{
							checkbox: true,
						},
						{
							field: 'operatorName',
							title: gameAreaCombogridColumnTitle1,
							width: 100
						},
						{
							field: 'areaNum',
							title: gameAreaCombogridColumnTitle2,
							width: 60
						}
					]],
					loadFilter: Utils.dataGridLoadFilter,
				});
			},
		},
		
		BattleServer: {
			create: function(labelContainer, inputContainer, multiple) {
				var multiple = arguments[2] === true ? arguments[2] : false;
				labelContainer[0].innerHTML = componentBattleServerCombogridLabel;
				inputContainer.combogrid({
					panelWidth: 200,
					multiple: multiple,
					idField: 'battleServerId',
					textField: 'battleServerName',
					url: '/index.php/BattleServer/manage/getListData',
					columns:[[
						{
							checkbox: true,
						},
						{
							field: 'operatorName',
							title: gameAreaCombogridColumnTitle1,
							width: 100
						},
						{
							field: 'areaNum',
							title: gameAreaCombogridColumnTitle2,
							width: 60
						}
					]],
					loadFilter: Utils.dataGridLoadFilter,
				});
			},
		},
	},
	
	Validatebox: {
		Username: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentUsernameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Password: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentPasswordValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		NewPassword: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentNewPasswordValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		ConfirmPassword: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentConfirmPasswordValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Name: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		OperatorName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentOperatorNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		OperatorFlag: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentOperatorFlagValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		IpAddress: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentIpAddressValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		ServerName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentServerNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Memo: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentMemoValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		AreaNum: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentAreaNumValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		PortGroup: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentPortGroupValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Domain: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentDomainValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		HttpPort: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentHttpPortLabel;
				inputContainer.validatebox();
			},
		},
		
		GameDir: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentGameDirValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		DatabaseName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentDatabaseNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Account: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentAccountValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		RoleName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentRoleNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		TimeCycle: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentTimeCycleValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Reason: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentReasonValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		SenderName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentSenderNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Title: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentTitleValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		CardName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentCardNameValidateboxLabel;
				inputContainer.validatebox();
			},
		},
		
		Version: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentVersionLabel;
				inputContainer.validatebox();
			},
		},
		
		DirectoryName: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentDirectoryNameLabel;
				inputContainer.validatebox();
			},
		},
		
		LineNum: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentLineNumLabel;
				inputContainer.validatebox();
			},
		}
	},
	
	Numberbox: {
		Count: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentCountNumberboxLabel;
				inputContainer.numberbox({
					min: 1,
				});
			},
		},
		
		TimeInterval: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentTimeIntervalNumberboxLabel;
				inputContainer.numberbox({
					min: 1,
				});
			},
		},
		
		MaxGameAreaNum: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentMaxGameAreaNumLabel;
				inputContainer.numberbox({
					min: 0,
				});
			},
		},
		
		Money: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentMoneyLabel;
				inputContainer.numberbox({
					min: 1,
				});
			}
		},
	},
	
	Textbox: {
		Content: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentContentTextboxLabel;
			},
		},
	},
	
	Datebox: {
		Search: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentSearchDateboxLabel;
				inputContainer.datebox({
					formatter: Utils.dateFormatter
				});
			},
		},
		
		Start: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentStartDateboxLabel;
				inputContainer.datebox({
					formatter: Utils.dateFormatter
				});
			},
		},
		
		End: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentEndDateboxLabel;
				inputContainer.datebox({
					formatter: Utils.dateFormatter
				});
			},
		},
	},

	Datetimebox: {
		GameAreaOpen: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentGameAreaOpenDatetimeboxLabel;
				inputContainer.datetimebox({
					formatter: Utils.datetimeFormatter
				});
			},
		},
		
		Start: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentStartDatetimeboxLabel;
				inputContainer.datetimebox({
					formatter: Utils.datetimeFormatter,
				});
			},
		},
		
		End: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentEndDatetimeboxLabel;
				inputContainer.datetimebox({
					formatter: Utils.datetimeFormatter,
				});
			},
		},
		
		Send: {
			create: function(labelContainer, inputContainer) {
				labelContainer[0].innerHTML = componentSendDatetimeboxLabel;
				inputContainer.datetimebox({
					formatter: Utils.datetimeFormatter,
				});
			},
		},
	},
	
	Range: {
		RoleLevel: {
			create: function(labelContainer, minInputContainer, maxInputContainer) {
				labelContainer[0].innerHTML = componentRoleLevelRangeLabel;
				minInputContainer.validatebox();
				maxInputContainer.validatebox();
			},
		},
		
		VipLevel: {
			create: function(labelContainer, minInputContainer, maxInputContainer) {
				labelContainer[0].innerHTML = componentVipLevelRangeLabel;
				minInputContainer.validatebox();
				maxInputContainer.validatebox();
			},
		},
	},
}